package com.hex.ds.hdrs.common.utils;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @Package: com.hex.ds.hdrs.common.utils
 * @ClassName MathUtil
 * @Description:
 * @Author: 数字转换工具类<gc.zuo>
 * @Date 2021/7/8 15:29
 * @Version v1.0
 **/
@Slf4j
public class MathUtil {

    public static double formatDouble(double number, int places) {
        BigDecimal bg = BigDecimal.valueOf(number);
        return bg.setScale(places, BigDecimal.ROUND_HALF_UP).doubleValue();
    }


}
